package dev.huidocs.docs.service;

import com.gitee.coadmin.base.PageInfo;
import dev.huidocs.docs.domain.DocResAccessedRecently;
import dev.huidocs.docs.service.dto.DocResAccessedRecentlyDTO;
import dev.huidocs.docs.service.dto.DocResAccessedRecentlyQueryParam;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Set;

/**
 * Accessed recently
 * @author jinjin
 * @since 2024-10-11
 */
public interface DocResAccessedRecentlyService {

    String CACHE_KEY = "docs:doc-res-accessed-recently";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<DocResAccessedRecentlyDTO>
    */
    PageInfo<DocResAccessedRecentlyDTO> pageByParam(DocResAccessedRecentlyQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<DocResAccessedRecentlyDTO>
    */
    List<DocResAccessedRecentlyDTO> listByParam(DocResAccessedRecentlyQueryParam query);

    long countByParam(DocResAccessedRecentlyQueryParam query);

    DocResAccessedRecentlyDTO getById(Long id);

    /**
     * 插入一条新数据。
     */
    void insert(DocResAccessedRecentlyDTO res);
    void updateById(DocResAccessedRecentlyDTO res);
    void removeByIds(Set<Long> ids);
}
